﻿using PersonalWeekReport.Models.Config;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Web;

namespace PersonalWeekReport.Models.Common
{
    public class Department
    {
        [Key]
        public Guid Id { set; get; }

        [Display(Name = "部门名称", ShortName = "部门")]

        public string DepartmentName { set; get; }


        public ICollection<Employee> Employees { set; get; }


        #region 所属公司

        public string CompanyId { set; get; }

        [ForeignKey("CompanyId")]
        public virtual Company Company { set; get; }
        #endregion


        #region 上级部门
        public string ParentDepartmentId { set; get; }

        [ForeignKey("ParentDepartmentId")]
        public virtual Department ParentDepartment { set; get; }

        #endregion


        public virtual ICollection<Department> ChildDeparments { set; get; }

        #region 部门日历
        [Editable(false)]
        public string DepartmentCanlendarId { set; get; }

        [ForeignKey("DepartmentCanlendarId")]
        public virtual DepartmentCanlendar DepartmentCanlendar { set; get; }

        #endregion
    }
}